package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	fmt.Println("client")
	client := new(http.Client)
	body1 := bytes.NewBuffer([]byte(`{"name":222,"age": 28}`))
	req, _ := http.NewRequest("POST", "http://localhost:8080/test", body1) // 如果什么都不用传参数 那么传递nil
	req.Header.Set("De", "dddd")
	req.Header.Set("de", "dddd")
	res, _ := client.Do(req)
	body := res.Body
	b, _ := io.ReadAll(body)
	fmt.Println(string(b))
}
